<template>
	<div class="news bg-f5">
		<ul class="mt10 bg-white">
			<!-- router-link tag="li" to="/personal/news/system" class="layout pt15 pb15 container border-b">
				<img style="width:30px;" src="../../../assets/icon17.png" alt="">
				<div class="flex_1 ml15">
					<p  class="layout fs15 black bold mb5">系统消息<span class="fs12 c666">2018-01-02</span></p>
					<p class="layout fs12 c666">您获得一张无门槛的优惠券，请查收<van-icon class="black" color="#666" size="14px" name="youjiantou"/></p>
				</div>
			</router-link>
			<router-link tag="li" to="/personal/news/order-msg" class="layout pt15 pb15 container">
				<img style="width:30px;" src="../../../assets/icon17.png" alt="">
				<div class="flex_1 ml15">
					<p  class="layout fs15 black bold mb5">订单消息<span class="fs12 c666">2018-01-02</span></p>
					<p class="layout fs12 c666">您获得一张无门槛的优惠券，请查收<van-icon class="black" color="#666" size="14px" name="youjiantou"/></p>
				</div>
			</router-link> -->
			<li class="layout pt15 pb15 container border-b" v-for="item in data" @click="jumpDetail(item)">
				<img style="width:30px;" src="../../../assets/icon17.png" alt="">
				<div class="flex_1 ml15">
					<p  class="layout fs15 black bold mb5">{{ item.title }}<span class="fs12 c666">{{ item.time }}</span></p>
					<p class="layout fs12 c666">{{ item.msg }}<van-icon class="black" color="#666" size="14px" name="youjiantou"/></p>
				</div>
			</li>
		</ul>
		<!-- <ul class="mt10 bg-white">
			<li class="layout pt15 pb15 container">
				<img style="width:30px;" src="../../../assets/icon18.png" alt="">
				<div class="flex_1 ml15">
					<p  class="layout fs15 black bold mb5">客服消息<span class="fs12 c666">2018-01-02</span></p>
					<p class="layout fs12 c666">亲，您的问题系统已经帮您解决了，请查看	<van-icon class="black" color="#666" size="14px" name="youjiantou"/></p>
				</div>
			</li>
		</ul> -->
	</div>
</template>

<script>
	export default{
		data()
		{
			return{
				data : [],
			}
		},
		created()
		{
			this.loadData();
		},
		methods:
		{
			loadData()
			{
				this.$http.get('/info/infoList').then(res=> {
					this.data = res.data;
				})
			},
			jumpDetail(item)
			{
				if(item.title == '系统消息'){
					this.$router.push('/personal/news/system')
				}
				else
					this.$router.push('/personal/news/order-msg')
			}
		}
	}
</script>

<style lang="less">
	.news{
		ul{
			li{
				&:last-child{
					border-bottom:none;
				}
			}
		}
	}
</style>